# -*- coding:utf-8 -*-

import requests
from lxml import html

url='http://lol.qq.com/'
r=requests.get(url).content


sel = html.fromstring(r)
 result=sel.xpath('//div//a/text()')
result1=sel.xpath('//div//a/@href')

print "文本的内容{}".format(result)
print "a连接{}".format(result1)
